package Text4;
import java.util.Scanner;
public class Main {
    public static void main1(String[] args) {
//        输入一个 n 行 m 列的整数矩阵，再输入 q 个询问，每个询问包含四个整数 x1,y1,x2,y2，
//        表示一个子矩阵的左上角坐标和右下角坐标。
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int q = scanner.nextInt();
        int[][] arr = new int[n+1][m+1];
        long[][] sum = new long[n+1][m+1];
        for (int i = 1; i <=n ; i++) {
            for (int j = 1; j <=m ; j++) {
                arr[i][j]=scanner.nextInt();
            }
        }
        for (int i = 1; i <=n ; i++) {
            for (int j = 1; j <=m ; j++) {
                sum[i][j]=sum[i-1][j]+sum[i][j-1]-sum[i-1][j-1]+arr[i][j];
            }
        }
        while(q-->0){
            int x1 = scanner.nextInt();
            int y1 = scanner.nextInt();
            int x2 = scanner.nextInt();
            int y2 = scanner.nextInt();
            System.out.println(sum[x2][y2]-sum[x1-1][y2]-sum[x2][y1-1]+sum[x1-1][y1-1]);
        }
    }

    public static void main(String[] args) {
//        输入一个长度为 n 的整数序列。接下来输入 m 个操作，
//        每个操作包含三个整数 l,r,c，表示将序列中 [l,r]之间的每个数加上 c。
//        请你输出进行完所有操作后的序列。
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int q = scanner.nextInt();
        int[]arr = new int[n+1];
        int[] b = new int[n+2];
        for (int i = 1; i <=n; i++) {
            arr[i]=scanner.nextInt();
        }
        for (int i = 1; i <=n ; i++) {
            b[i]=arr[i]-arr[i-1];
        }
        while(q-->0){
            int l = scanner.nextInt();
            int r = scanner.nextInt();
            int c = scanner.nextInt();
            b[l]+=c;
            b[r+1]-=c;
        }
        for (int i = 1; i <=n ; i++) {
            arr[i]=arr[i-1]+b[i];
        }
        for (int i = 1; i <=n ; i++) {
            System.out.print(arr[i]+" ");
        }
    }

}
